//
//   Copyright 2011 Gynvael Coldwind & Mateusz "j00ru" Jurczyk
//
//   Licensed under the Apache License, Version 2.0 (the "License");
//   you may not use this file except in compliance with the License.
//   You may obtain a copy of the License at
//
//       http://www.apache.org/licenses/LICENSE-2.0
//
//   Unless required by applicable law or agreed to in writing, software
//   distributed under the License is distributed on an "AS IS" BASIS,
//   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
//   See the License for the specific language governing permissions and
//   limitations under the License.
//
#pragma once

#define PARAMETRIZED_OBJECT_COUNT 100

#include <stdint.h>
#include <vector>
#include "player.h"
#include "j00ru.h"
#include "record.h"
#include "object.h"

#define TICK_INTERVAL 20 // the amount of milliseconds between each tick


typedef struct tagGAME_STATE
{
  //
  // Player information
  //
  PLAYER_STRUCT* players;
  int activePlayer;
  float timeLeft;

  //
  // Level information
  //
  LEVEL_STRUCT* currentLevel;
  int levelNumber;

  // TODO
  

} GAME_STATE;

extern GAME_STATE g_GameState;
extern uint32_t g_Ticks;
extern uint32_t g_PendingMs;

extern RECORDER_STRUCT g_Recorder;

extern int g_ObjectParams[PARAMETRIZED_OBJECT_COUNT][3];

extern vector<OBJECT_STRUCT*> g_Objects;

extern int g_GameMode;
extern int g_ModeStartTime;
extern int g_MenuItem;

#define MENU_ITEM_PLAY      0
#define MENU_ITEM_ABOUT     1
#define MENU_ITEM_EXIT      2

#define GAME_MODE_INTRO         0
#define GAME_MODE_MENU          1
#define GAME_MODE_ABOUT         2
#define GAME_MODE_GAMEPLAY      3
#define GAME_MODE_LOSE          4
#define GAME_MODE_EXIT          5
#define GAME_MODE_LVL_FINISHED  6
#define GAME_MODE_GAME_FINISHED 7
#define GAME_MODE_BEFORE_LEVEL  8
// TODO...


//
// Functions
//
void game_SwitchMode(int mode);

